﻿<UserControl x:Class="GKS.XAML.UserControls.LedgerViewUC"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:GKS.Model.ViewModels;assembly=GKS.Model"
             mc:Ignorable="d" 
             d:DesignHeight="610" d:DesignWidth="850">
    
    <UserControl.DataContext>
        <local:GKSViewLedgerModel></local:GKSViewLedgerModel>
    </UserControl.DataContext>

    <Grid Height="590" Width="840">
        <Label Content="Select a head for a project and click the 'View' button below:" Height="28" HorizontalAlignment="Left" Margin="87,37,0,0" Name="label3" VerticalAlignment="Top" Width="311" />

        <!--<Label Content="Project(s): " Height="23" HorizontalAlignment="Left" Margin="32,131,0,0" Name="label1" VerticalAlignment="Top" Width="59" />
        <ListBox Height="293" HorizontalAlignment="Left" Margin="35,153,0,0" Name="checkboxList" VerticalAlignment="Top" Width="141" 
                 SelectionMode="Multiple" ItemsSource="{Binding Projects}" SelectedItem="{Binding Path=SelectedTestProjects, Mode=TwoWay}">
            <ListBox.ItemContainerStyle>
                <Style TargetType="{x:Type ListBoxItem}">
                    <Setter Property="IsSelected" Value="{Binding IsSelected}"/>
                </Style>
            </ListBox.ItemContainerStyle>
            <ListBox.ItemContainerStyle>
                <Style>
                    <Setter Property="ListBoxItem.Background" Value="Transparent"/>
                    <Setter Property="ListBoxItem.Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="{x:Type ListBoxItem}">
                                <Border x:Name="Bd" 
                    SnapsToDevicePixels="true" 
                    Background="{TemplateBinding Background}" 
                    BorderBrush="{TemplateBinding BorderBrush}" 
                    BorderThickness="{TemplateBinding BorderThickness}" 
                    Padding="{TemplateBinding Padding}">
                                    <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
                                  VerticalAlignment="{TemplateBinding VerticalContentAlignment}" 
                                  SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                                </Border>
                                <ControlTemplate.Triggers>
                                    <Trigger Property="IsSelected" Value="true">
                                        <Setter Property="Background" TargetName="Bd" Value="Transparent" />
                                    </Trigger>
                                </ControlTemplate.Triggers>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </ListBox.ItemContainerStyle>
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <CheckBox IsChecked="{Binding IsSelected}" Content="{Binding Item}"/>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>-->
        
        <Label Content="Project: " Height="26" HorizontalAlignment="Left" Margin="87,0,0,497" Name="label1" VerticalAlignment="Bottom" Width="47" />
        <ComboBox DisplayMemberPath="Name" HorizontalAlignment="Right" ItemsSource="{Binding Path=AllProjects, Mode=OneWay}" Margin="0,71,101,0" Name="comboBoxProjectItems" SelectedItem="{Binding Path=SelectedProject, Mode=TwoWay}" VerticalAlignment="Top" Width="607" />

        <Label Content="Head: " Height="26" HorizontalAlignment="Left" Margin="96,0,0,467" Name="label2" VerticalAlignment="Bottom" Width="38" />
        <ComboBox DisplayMemberPath="Name" HorizontalAlignment="Right" Margin="0,101,101,0" Name="HeadCombo" VerticalAlignment="Top" Width="607"
                  ItemsSource="{Binding Path=AllHeads, Mode=OneWay}" SelectedItem="{Binding Path=SelectedHead, Mode=TwoWay}" />

        <CheckBox Content="Show cash/bank transactions" IsChecked="{Binding Path=ShowCashOrBankTransaction, Mode=TwoWay}" Height="16" HorizontalAlignment="Left" Margin="132,133,0,0" Name="showCashOrBankTransactionCheckBox" VerticalAlignment="Top" />

        <Label Content="Financial year end date:" Height="28" HorizontalAlignment="Left" Margin="498,128,0,0" Name="label4" VerticalAlignment="Top" />
        <DatePicker Height="25" SelectedDate="{Binding Path=FinacialYearEndDate}" HorizontalAlignment="Right" Margin="0,129,101,0" Name="endDateDatePicker" VerticalAlignment="Top" Width="115" />

        <Button Content="View" Height="23" HorizontalAlignment="Left" Margin="381,154,0,0" Name="ViewLedgerButton" VerticalAlignment="Top" Width="75" Click="ViewLedgerButton_Click" />

        <DataGrid AutoGenerateColumns="True" IsReadOnly="True" Height="350" HorizontalAlignment="Left" Margin="75,185,0,0" Name="LedgerDataGrid" VerticalAlignment="Top" Width="690" 
                  ItemsSource="{Binding Path=LedgerGridViewItems, Mode=OneWay}" >
        </DataGrid>
        <!--<Button Content="Select all" Command="{Binding SelectAllCommand}" Height="23" HorizontalAlignment="Left" Margin="35,457,0,0" Name="button4" VerticalAlignment="Top" Width="141" />
        <Button Content="Unselect all" Command="{Binding UnselectAllCommand}" Height="23" HorizontalAlignment="Left" Margin="35,486,0,0" Name="button5" VerticalAlignment="Top" Width="141" />-->

        <!--<Button Content="OK" Height="23" HorizontalAlignment="Left" Margin="638,524,0,0" Name="button3" VerticalAlignment="Top" Width="75" />
        <Button Content="Cancel" Height="23" HorizontalAlignment="Left" Margin="727,524,0,0" Name="button1" VerticalAlignment="Top" Width="75" />-->

    </Grid>
</UserControl>
